package com.csun.cmny.provider.service.impl;

import com.csun.cmny.provider.dao.OldmanNurseHiMapper;
import com.csun.cmny.provider.dao.SetMealPricesaveMapper;
import com.csun.cmny.provider.dao.SetMealSaveMapper;
import com.csun.cmny.provider.dto.SetMaelSaveDto;
import com.csun.cmny.provider.dto.SetMealSaveParameterDto;
import com.csun.cmny.provider.pojo.OldmanNurseHi;
import com.csun.cmny.provider.pojo.OmcSetMealPricesave;
import com.csun.cmny.provider.service.OldmanNurseHiService;
import com.csun.cmny.provider.vo.SetMealSaveItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author huangxm
 * @description:
 * @date 2019/3/27 14:14
 */
@Service
public class OldmanNurseHiServiceImpl implements OldmanNurseHiService {

    @Autowired
    private OldmanNurseHiMapper oldmanNurseHiMapper;

    @Autowired
    private SetMealSaveMapper setMealSaveMapper;

    @Autowired
    private SetMealPricesaveMapper setMealPricesaveMapper;

    @Override
    public int deleteByPrimaryKey(Integer historyId) {
        return oldmanNurseHiMapper.deleteByPrimaryKey(historyId);
    }

    @Override
    public int insert(OldmanNurseHi record) {
        return oldmanNurseHiMapper.insert(record);
    }

    @Override
    public int insertNew(SetMealSaveParameterDto setMealSaveParameterDto) {
        return setMealPricesaveMapper.insert(setMealSaveParameterDto);
    }

    @Override
    public int insertAddItem(SetMealSaveItemVo setMealSaveItemVo) {
        return setMealSaveMapper.insertItem(setMealSaveItemVo);
    }

    @Override
    public List<SetMealSaveParameterDto> selectAll(Map<String,Object> queryMap){
        return setMealPricesaveMapper.selectAll(queryMap);
    }

    @Override
    public SetMealSaveParameterDto selectByIdDay(Map<String,Object> queryMap){
        return setMealPricesaveMapper.selectByIdDay(queryMap);
    }

    @Override
    public List<SetMealSaveItemVo> selectItem(Map<String,Object> map){
        return setMealSaveMapper.selectItem(map);
    }

    @Override
    public int deleteItemById(Map<String,Object> map){
        return setMealSaveMapper.deleteItemById(map);
    }
    @Override
    public int deleteAllById(Map<String,Object> map){
        return setMealPricesaveMapper.deleteById(map);
    }

    @Override
    public int deleteAll(Map<String,Object> map){
         setMealSaveMapper.deleteItemAll(map);
        return setMealPricesaveMapper.deleteAll(map);
    }

    @Override
    public int insertSelective(OldmanNurseHi record) {
        return oldmanNurseHiMapper.insertSelective(record);
    }

    @Override
    public OldmanNurseHi selectByPrimaryKey(Integer historyId) {
        return oldmanNurseHiMapper.selectByPrimaryKey(historyId);
    }

    @Override
    public int updateByPrimaryKeySelective(OldmanNurseHi record) {
        return oldmanNurseHiMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(OldmanNurseHi record) {
        return oldmanNurseHiMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<OldmanNurseHi> getAllHistoryByOldmanId(Integer oldmanId) {
        return oldmanNurseHiMapper.getAllHistoryByOldmanId(oldmanId);
    }

    @Override
    public int deleteByOldmanId(Integer oldmanId) {
        return oldmanNurseHiMapper.deleteByOldmanId(oldmanId);
    }

    @Override
    public OldmanNurseHi selectRecentNurse(Integer oldmanId) {
        return oldmanNurseHiMapper.selectRecentNurse(oldmanId);
    }
}
